xen/arm: Handle static heap pages in boot and heap allocator
authorHenry Wang <Henry.Wang@arm.com>
Thu, 8 Sep 2022 11:09:10 +0000 (11:09 +0000)
committerJulien Grall <jgrall@amazon.com>
Thu, 8 Sep 2022 11:27:15 +0000 (12:27 +0100)
commitf541464af3799c91534c48c2df55708662b78b88
treecc9867bb73d1eda7097b033e128360a4f4aa8fb2
parentf030935efb376bcbdf2e69692f951775bdf9ab58
xen/arm: Handle static heap pages in boot and heap allocator

This commit firstly adds a bool field `static_heap` to bootinfo.
This newly introduced field is set at the device tree parsing time
if the static heap ranges are defined in the device tree chosen
node.

For Arm32, In `setup_mm`, if the static heap is enabled, we use the
static heap region for both domheap and xenheap allocation. Note
that the xenheap on Arm32 should be always contiguous, so also add
a helper fit_xenheap_in_static_heap() for Arm32 to find the required
xenheap in the static heap regions.

For Arm64, In `setup_mm`, if the static heap is enabled and used,
we make sure that only these static heap pages are added to the boot
allocator. These static heap pages in the boot allocator are
added to the heap allocator at `end_boot_allocator()`.

If the static heap is disabled, we stick to current page allocation
strategy at boot time.

Also, take the chance to correct a "double not" print in Arm32
`setup_mm()` and replace the open-coding address ~0 by INVALID_PADDR.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/bootfdt.c
xen/arch/arm/include/asm/setup.h
xen/arch/arm/setup.c